home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_400
/
429_01
/
chess12
/
log.cpp
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1994-03-25
|
415 b
|
28 lines
#include <dos.h>
#include <stdio.h>
#include <stdlib.h>
void log (char *msg)
{
union REGS r;
FILE *fp = fopen("out","a");
fputs(msg, fp);
fputc('\n', fp);
fclose(fp);
// check if ESC key pressed
r.h.ah = 1;
int86(0x16, &r, &r);
if (r.x.flags & 1)
{
r.h.ah = 0;
int86(0x16, &r, &r);
if (r.h.al == 27)
exit(1);
}
return;
}